package com.ruoyi.web.controller.sqldow;

import com.ruoyi.sqldow.service.impl.EnergyChartsServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;


import java.util.List;
import java.util.Map;
/**
 * Author 许家森
 * Date 2022/3/5
 * Email 3448324670@qq.com
 */
@Controller
public class EnergyConsumptionChartsController {
    @Autowired
    private EnergyChartsServiceImpl energyChartsService;

    @GetMapping("view/energy")
    @ResponseBody
    public List<List<Map<Object,Object>>> EnergyCharts(@RequestParam("year") String year){
        if(year!=null) {
            return energyChartsService.selectenergy(year);
        }
        return null;

    }
}
